package com.chagee.store.operation.server.config;

import com.chagee.store.operation.server.model.info.TaskInfo;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @Author : hk
 * @Date : 2024/7/5
 */

/*@Data
@Configuration
@RefreshScope
@ConfigurationProperties(prefix = "store.task")
public class StoreTaskConfig {

	private List<TaskInfo> multiple;

	public TaskInfo getByType(String taskCode) {
		TaskInfo taskInfo = new TaskInfo();
		for (TaskInfo info : multiple) {
			if (Objects.equals(taskCode, info.getTask())) {
				BeanUtils.copyProperties(info,taskInfo);
				return taskInfo;
			}
		}
		return null;
	}
}*/
